<template>
    <el-select
        :value="value"
        @change="emit"
        placeholder="请选择分类">
        <el-option
        v-for="channel in channelList"
        :key="channel.id"
        :label="channel.cate_name"
        :value="channel.id"></el-option>
    </el-select>
</template>

<script>
import { getArticleClass } from '@/api/article'
export default {
  data () {
    return {
      channelList: []
    }
  },
  mounted () {
    this.getChanelList()
  },
  methods: {
    async getChanelList () {
      const res = await getArticleClass()
      this.channelList = [...res.data]
    },
    emit (e) {
      this.$emit('input', e)
    }
  },
  props: {
    value: {
      type: [Number, String]
    }
  }
}
</script>

<style>

</style>
